package jjn.acwing;

import java.util.Scanner;

/**
 * @author Jiang Jining
 * @since 2023-09-10 19:25
 */
public class Acwing777 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String line = sc.next();
            if (".".equals(line)) {
                break;
            }
            int n = line.length();
            for (int i = 1; i <= n; i++) {
                String str = line.substring(0, i);
                if (n % str.length() != 0) {
                    continue;
                }
                StringBuilder s = new StringBuilder();
                int count = n / str.length();
                s.append(str.repeat(count));
                if (s.toString().equals(line)) {
                    System.out.println(count);
                    break;
                }
            }
        }
    }
}
